﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using AzureTracer.Resources;

namespace AzureTracer.Common
{
    public class ResourceHelper
    {
        public static string NewContent(int value)
        {
            switch (value)
            {
                case 30:
                    return labels.NewContent30;
                case 60:
                    return labels.NewContent60;
                case 360:
                    return labels.NewContent360;
                case 0:
                    return labels.NewContent0;
                default:
                    return string.Empty;
            }
        }

        public static string TraceFrom(int value)
        {
            switch (value)
            {
                case 1:
                    return labels.TraceFrom1;
                case 3:
                    return labels.TraceFrom3;
                case 7:
                    return labels.TraceFrom7;
                case 14:
                    return labels.TraceFrom14;
                case 31:
                    return labels.TraceFrom31;
                case 90:
                    return labels.TraceFrom90;
                default:
                    return string.Empty;
            }
        }

        public static string ExceptionMessage(Exception ex)
        {
            if (ex.Message.Contains("AuthenticationFailed"))
                return labels.AuthenticationFailed;
            else
                return labels.InvalidAccount;
        }

        public static string SyncExceptionMessage(Exception ex)
        {
            if (ex.Message == "NotFound")
                return labels.InvalidAccountSync;
            else if (ex.Message.Contains("AuthenticationFailed"))
                return labels.AuthenticationFailedSync;
            else
                return labels.SyncFailured;
        }
    }
}
